package router

import (
	"gateway/handler/api"
	"github.com/gin-gonic/gin"
)

// StateMachine 状态机路由
func StateMachine(v1 *gin.RouterGroup) {
	stateMachine := v1.Group("/state-machine")
	{
		stateMachine.POST("/transition", api.TransitionOrderState)     // 转换订单状态
		stateMachine.GET("/state-info", api.GetOrderStateInfo)        // 获取订单状态信息
		stateMachine.GET("/diagram", api.GetStateMachineDiagram)      // 获取状态机流程图
		stateMachine.POST("/validate", api.ValidateTransition)        // 验证状态转换
		stateMachine.GET("/history", api.GetStateHistory)            // 获取状态历史
	}
}

